package cn.crce.cloud9.comp;

import javax.swing.*;
import java.awt.*;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月12日 下午 10:22
 */
public class Case4 {
    public static void main(String[] args){
        BeijingFrame frame = new BeijingFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.show();
    }
}
//*********Found*********
class  BeijingFrame  extends JFrame{
    public BeijingFrame(){
        setTitle("Welcome to Beijing");
        Container contentPane = getContentPane();
        BeijingPanel panel = new BeijingPanel();
        contentPane.add(panel);
        pack();
    }
}

class BeijingPanel extends JPanel {
    public BeijingPanel(){
        //*********Found*********
        setLayout(new BorderLayout());
        ImageIcon icon = new ImageIcon("./comp/tiantan.jpg");
        //*********Found*********
        jLC = new JLabel( icon );
        add(jLC, BorderLayout.CENTER);
        lpanel = new JPanel();
        jLS = new JLabel("The Temple of Heaven");
        lpanel.add(jLS);
        add(lpanel, BorderLayout.SOUTH);
    }
    private JLabel jLC;
    private JLabel jLS;
    private JPanel panel;
    private JPanel lpanel;
}
